#ifndef __XCAN_DEV__
#define __XCAN_DEV__
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/led.h>
#include <linux/can/netlink.h>
#include <linux/can/skb.h>
#include <linux/netdevice.h>

/* <linux/can/dev.h> */
#define CAN_SYNC_SEG 1

/* <linux/netdevice.h */
struct xcan_device_stats {
	unsigned long	rx_packets;
	unsigned long	tx_packets;
	unsigned long	rx_bytes;
	unsigned long	tx_bytes;
	unsigned long	rx_errors;
	unsigned long	tx_errors;
	unsigned long	rx_dropped;
	unsigned long	tx_dropped;
	unsigned long	multicast;
	unsigned long	collisions;
	unsigned long	rx_length_errors;
	unsigned long	rx_over_errors;
	unsigned long	rx_crc_errors;
	unsigned long	rx_frame_errors;
	unsigned long	rx_fifo_errors;
	unsigned long	rx_missed_errors;
	unsigned long	tx_aborted_errors;
	unsigned long	tx_carrier_errors;
	unsigned long	tx_fifo_errors;
	unsigned long	tx_heartbeat_errors;
	unsigned long	tx_window_errors;
	unsigned long	rx_compressed;
	unsigned long	tx_compressed;
};

int xcan_calc_bittiming(const struct can_priv *priv, struct can_bittiming *bt,
                        const struct can_bittiming_const *btc);
void xcan_change_state(struct can_priv *priv, struct can_frame *cf,
                       enum can_state tx_state, enum can_state rx_state);
void xcan_bus_off(struct can_priv *priv);

#endif /* __XCAN_DEV__ */
